//
//  LXAuthorCollectionViewCell.m
//  喜马拉雅改良版框架
//
//  Created by liuxin on 15/12/23.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "LXAuthorCollectionViewCell.h"

@implementation LXAuthorCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews{
    self.AuthorImage = [[UIImageView alloc]init];
    [self.contentView addSubview:self.AuthorImage];
    [self.AuthorImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.mas_equalTo(0);
        make.bottom.mas_equalTo(-30);
    }];
    
    self.AuthorName = [[UILabel alloc]init];
    self.AuthorName.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.AuthorName];
    [self.AuthorName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.right.left.mas_equalTo(0);
        make.top.mas_equalTo(_AuthorImage.mas_bottom);
    }];
}
-(void)setCellDic:(NSDictionary *)cellDic{
    _AuthorName.text = cellDic[@"nickname"];
    [_AuthorImage sd_setImageWithURL:[NSURL URLWithString:cellDic[@"smallLogo"]] placeholderImage:[UIImage imageNamed:ImagePlaceHolder]];
}
@end
